import 'package:get/get.dart';
import 'package:getx_scaffold_ohos/getx_scaffold_ohos.dart';

class MainController extends GetxController with BaseControllerMixin {

  PageController pageController = PageController(initialPage: 0);
  var pageIndex = 0;

  @override
  void onReady() {
    super.onReady();
  }

  void changePage(int index) {
    pageIndex = index;
    pageController.jumpToPage(index);
    updateUi();
  }

  @override
  void onClose() {
    pageController.dispose();
    super.onClose();
  }

  @override
  String get builderId => 'main';
}
